<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="系统通知" name="1">
        <system-notice v-if="isSystem"></system-notice>
      </el-tab-pane>
      <el-tab-pane label="会员通知" name="2">
        <member-notice v-if="isMember"></member-notice>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import SystemNotice from './components/systemNotice';
  import MemberNotice from './components/memberNotice';
  export default {
    name: 'NoticeManage',
    components: {
      SystemNotice,
      MemberNotice
    },
    data() {
      return {
        // 选项卡默认选中
        activeName: '1',
        // 系统通知开关
        isSystem: true,
        // 会员通知开关
        isMember: false
      }
    },
    methods: {
      handleClick(tab, event) {
        this.activeName = tab.name;
        if (tab.name === '1') {
          this.isSystem = true;
          this.isMember = false;
        } else {
          this.isSystem = false;
          this.isMember = true;
        }
      }
    }
  }
</script>
